package com.ruoyi.project.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.project.domain.entity.*;
import com.ruoyi.project.domain.query.ProjectQuery;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface IProjectService extends IService<Project> {

    //分页
    TableDataInfo getPage(ProjectQuery query);


    //分页
    TableDataInfo getSaleProjectPage(ProjectQuery query);

    Map<String,BigDecimal> getCompeleteMoney(ProjectQuery query);

    //分页


    //分页
    TableDataInfo appListProject(ProjectQuery query);


    //分页
    TableDataInfo allocations(ProjectQuery query);


    //新增
    Project addInfo(Project project);

    Boolean updateInfo(Project project);

    Project addSaleProject(Project project);

    Boolean updateSaleProject(Project project);

    boolean checkSaleMoney(Project project);

 //删除

    Boolean deleteInfo(String id);

    //获取详情

    Project getInfoById(String id);

    ProjectResult getResultInfoById(String id);

    //首页分页
    TableDataInfo getMyJoinListPage(ProjectQuery query);

    //首页分页
    TableDataInfo getAssistListPage(ProjectQuery query);


    Map<String, BigDecimal> getMyJoinListCount(ProjectQuery query);

    //当前年份的
    List<DataView> getFirstPanelByYear(ProjectQuery query);

    //柱状图
    DataView getProjectStatus(ProjectQuery query);

    //饼图的
    DataView getPieData(ProjectQuery query);

    //折线图的
   DataView getLineData(ProjectQuery query);

   //销售排行榜
   Map<String,List<DataView>>  getRank(ProjectQuery query);

    //
    CountAndList waitPayment(ProjectQuery query);

    //
    CountAndList getWarrantyList(ProjectQuery query);

    //
    CountAndList overTimeList(ProjectQuery query);

    //
    CountAndList getImplement(ProjectQuery query);

    TableDataInfo allProjectYear(ProjectQuery query);



    List<Project> myAccountingList(ProjectQuery query);

    //首页分页
    TableDataInfo getMyCreateListPage(ProjectQuery query);

    //首页分页
    TableDataInfo needHandleProject(ProjectQuery query);


    Map<String,Object> myListProcessing();

    Map<String,BigDecimal> getAllDetail();

    TableDataInfo warrantyTime(ProjectQuery query);

    List<String> getMessage(ProjectQuery query);



    void createPay(String projectNo);

    @Select("SELECT MAX(c.codeValue) FROM Code c WHERE c.codeValue LIKE :prefix%")
    String findMaxCodeByPrefix(@Param("prefix") String prefix);

}
